package com.wanxi.controller;

import com.wanxi.dto.NewsDTO;
import com.wanxi.model.NewsQuery;
import com.wanxi.result.CommonResult;
import com.wanxi.service.FrontNewsService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(description = "新闻相关接口")
@RestController
@RequestMapping("/front/news")
public class FrontNewsController {

    @Autowired
    private FrontNewsService frontNewsService;

    @ApiOperation(value = "查询新闻")
    @ApiResponses({
            @ApiResponse(code = 200,message = "OK",response = NewsDTO.class,responseContainer = "List")
    })
    @GetMapping("/findNews")
    public CommonResult findNews(NewsQuery newsQuery){
        return frontNewsService.findNews(newsQuery);
    }
}
